Add setup script and skills for Azure AI Content Understanding#48893
Open
changjian-wang wants to merge 27 commits into
Open
Add setup script and skills for Azure AI Content Understanding#48893changjian-wang wants to merge 27 commits into
changjian-wang wants to merge 27 commits into
Conversation
…AI Content Understanding Java SDK - Created `run_sample.sh` to compile and execute Java samples with Maven. - Added `setup_samples.sh` to check prerequisites, install SDK from Maven Central or build locally, and create a sample `.env` file. - Introduced `SKILL.md` for interactive setup of environment variables required for running samples. - Updated `README.md` to include information about new GitHub Copilot skills for environment setup and sample execution.
…etter navigation and user guidance Co-authored-by: Copilot <copilot@github.com>
- Introduced `run_sample.sh` to execute specific Java samples with Maven. - Added `setup_samples.sh` to prepare the environment, check prerequisites, and create a `.env` file. - Created `SKILL.md` to guide users in setting up their environment variables interactively. - Updated `README.md` to reflect new skills for environment setup and sample execution.
yungshinlintw
requested changes
Apr 23, 2026
…eshooting notes for Java SDK setup Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
- Added a helper function to offer installation of JDK and Maven via package managers. - Improved prerequisite checks for JDK and Maven, including automatic installation prompts. - Refactored dependency installation steps to avoid redundant prompts and added a marker for dependency resolution. - Enhanced .env file configuration with improved user prompts and automatic detection of existing model defaults. - Introduced a PowerShell loader script for easier environment variable loading on Windows. - Updated comments and code structure for better readability and maintainability. Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds developer-facing tooling and documentation to make it easier to set up environment variables and run Azure AI Content Understanding Java SDK samples, along with GitHub Copilot skills that guide users through common workflows.
Changes:
- Added a README “GitHub Copilot Skills” section and expanded navigation/next-steps links.
- Introduced interactive setup scripts (bash + PowerShell) to validate prerequisites, resolve dependencies, and generate
.env+ aload-env.ps1helper. - Added Copilot skill knowledge bases for setup, sample running, and domain knowledge; added a bash sample runner script.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/contentunderstanding/azure-ai-contentunderstanding/README.md | Adds TOC and documents available Copilot skills with links and usage guidance. |
| sdk/contentunderstanding/azure-ai-contentunderstanding/.github/skills/cu-sdk-setup/scripts/setup_user_env.sh | Interactive bash setup to check prerequisites, resolve deps, and create .env + loader helper. |
| sdk/contentunderstanding/azure-ai-contentunderstanding/.github/skills/cu-sdk-setup/scripts/setup_user_env.ps1 | PowerShell equivalent of the setup flow for Windows/cross-platform PS users. |
| sdk/contentunderstanding/azure-ai-contentunderstanding/.github/skills/cu-sdk-setup/SKILL.md | Copilot skill guidance for environment setup and troubleshooting. |
| sdk/contentunderstanding/azure-ai-contentunderstanding/.github/skills/cu-sdk-sample-run/scripts/run_sample.sh | Adds a helper to list and run specific samples, optionally loading .env. |
| sdk/contentunderstanding/azure-ai-contentunderstanding/.github/skills/cu-sdk-sample-run/SKILL.md | Copilot skill guidance for selecting, configuring, and running samples. |
| sdk/contentunderstanding/azure-ai-contentunderstanding/.github/skills/cu-sdk-common-knowledge/SKILL.md | Copilot domain knowledge and official documentation pointers for Content Understanding. |
- run_sample.sh: parse .env without eval; only accept NAME=VALUE assignments and warn on malformed lines, removing the command-injection risk. - run_sample.sh: run 'mvn -DskipTests test-compile exec:java' so sample classes are compiled on a clean checkout before being executed. - SKILL.md: soften the 'must build from repo root' wording; building from the package directory works for most users since the parent POM resolves via relativePath and dependencies come from published artifacts.
…-skills # Conflicts: # sdk/contentunderstanding/azure-ai-contentunderstanding/README.md
Replace 'ltrim' inline comment with 'strip leading whitespace' so cspell no longer flags it as an unknown word.
…d Sample16 coverage - Restructure sample-run SKILL: 4 -> 6 numbered steps (Navigate, Build, Configure Env, Choose Sample, Configure Sample-Specific Settings, Run) - Add Sample16_CreateAnalyzerWithLabels coverage: explicit Manual upload steps, training data file inventory (2 receipts x 3 files), 5-question ASK USER flow, no-training fallback, troubleshooting rows - Add Sample_Advanced_ToLlmInput entry under Advanced Helpers - Settings table: add Sample15 cross-resource env vars (SOURCE_RESOURCE_ID, SOURCE_REGION, TARGET_REGION, TARGET_KEY) so it matches what Sample15_GrantCopyAuth.java actually reads - Sample16 section: clarify SAS prefix trailing slash behavior; note Java parity with Python (Option A only, no auto-upload); Portal navigation hint - cu-sdk-setup: add ASK USER for Sample16 training data and add SAS URL/PREFIX template add-on
…improved training data handling - Updated the sample to support two options for configuring training data: - Option A: Use a pre-generated SAS URL for Azure Blob Storage. - Option B: Automatically upload local label files and generate a User Delegation SAS URL using DefaultAzureCredential. - Renamed "Total" field to "TotalPrice" in the field schema for consistency. - Improved documentation to clarify the setup process for training data. - Enhanced test cases to reflect changes in the sample and ensure proper functionality with both training data options. Co-authored-by: Copilot <copilot@github.com>
…re/azure-sdk-for-java into changjian-wang/cu-sdk-skills
After merging main, eng/versioning/version_client.txt expects azure-storage-blob 12.33.4 but pom.xml still pinned 12.33.3, causing the 'Verify versions in POM files' pipeline step to fail.
cspell flagged 'srcs' as an unknown word in 4 files. Replaced 'Knowledge srcs:' with 'Knowledge sources:' in the printed label across the Sample16 sync/async samples (and matching tests for consistency), the run_sample.sh DEMO MODE message, and the SKILL.md prompt. The label now matches the underlying API name (getKnowledgeSources).
- pom.xml: Move azure-storage-blob from compile to test scope. The dependency is only used by Sample16 (compiled as test sources) and tests, so it should not be a transitive dependency of library consumers. - Sample16_CreateAnalyzerWithLabels.java / Async: Set SAS startsOn 5 minutes in the past to tolerate clock skew between the local machine and the storage service. Without this buffer, GetUserDelegationKey/SAS generation can intermittently fail with AuthenticationFailed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces new developer tooling and documentation to support running and understanding Java SDK samples for Azure AI Content Understanding. The main changes include the addition of a comprehensive skill knowledge base, a robust script for running Java samples, and a setup script to prepare the local environment. These improvements make it easier for developers to get started, run, and troubleshoot sample code for the SDK.
Developer Documentation and Knowledge Base:
cu-sdk-common-knowledgeskill inSKILL.md, providing detailed guidance, official documentation links, and copilot instructions for answering questions about Content Understanding concepts, analyzers, API operations, and Java SDK usage.Sample Execution Tooling:
run_sample.shscript to list and execute specific Java sample classes, with support for environment variable loading, dry-run, and helpful error messages.Sample Environment Setup:
setup_samples.shscript to automate environment setup: checks Java/Maven prerequisites, attempts to resolve the SDK from Maven Central or builds it locally, and generates a template.envfile for credentials and configuration.